<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="百度" onclick="goBaidu()">
<br>
<input type="button" value="前进" onclick="history.forward()">

<a href="test2.html">test</a>
<hr>



</body>
</html>
<script type="text/javascript">
    function goBaidu() {
        console.log(location.href)
        location.href="http://www.baidu.com";
    }
    // function forward() {
    //     history.forward();
    // }

</script>